import globals from "globals";
import pluginJs from "@eslint/js";
import pluginVue from "eslint-plugin-vue";


export default [
  {files: ["**/*.{js,mjs,cjs,vue}"]},
  {files: ["**/*.js"], languageOptions: {sourceType: "commonjs"}},
  {languageOptions: { globals: {
    ...globals.browser,
    ...globals.node, 
    template: true,
    layui: true,
    layer: true,
    ELMP: true,
    _: true,
    treeTool: true,
    Vue: true,
    LS: true,
  } }},
  pluginJs.configs.recommended,
  ...pluginVue.configs["flat/essential"],
  {
    rules: {
      'n/no-callback-literal': 'off',
      'no-template-curly-in-string': 'off',
      'no-new': 'off',
      'no-unused-vars': 'warn',
      'no-extra-boolean-cast': 'warn',
      'no-useless-escape': 'warn',
      'no-mixed-spaces-and-tabs': 'warn',
      'no-extra-semi': 'warn',
      eqeqeq: 'off',
      'no-var': 'off'
    }
  }
];